jQuery(document).ready(function() {

    /*
        Background slideshow
    */
    $.backstretch(["./images/1.jpg","./images/2.jpg", "./images/3.jpg"], { duration: 3000, fade: 750 });
    /*
        表单校验
    */
    $('.register form').submit(function() {
        var userName = $(this).find('input#txtUserName').val();
        if (userName == '') {
            $(this).find("label[for='txtUserName']").append("<span style='display:none' class='red'> - 请输入账号.</span>");
            $(this).find("label[for='txtUserName'] span").fadeIn('medium');
            $(this).find('input#txtUserName').focus();
            return false;
        }
        var password = $(this).find('input#txtPassword').val();
        if (password == '') {
            $(this).find("label[for='txtPassword']").append("<span style='display:none' class='red'> - 请输入你的密码.</span>");
            $(this).find("label[for='txtPassword'] span").fadeIn('medium');
            $(this).find('input#txtPassword').focus();
            return false;
        }
    });
});